//
//  JZBInputAlertViewController.m
//  JZB
//
//  Created by  on 2022/9/1.
//

#import "JZBInputAlertViewController.h"

@interface JZBInputAlertViewController ()
@property (strong, nonatomic) IBOutlet JZBTextField *input;

@end

@implementation JZBInputAlertViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.input.attributedPlaceholder = [[NSAttributedString alloc] initWithString:LS(@"请输入昵称") attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#999999"]}];
    
}
- (IBAction)actionforbtn:(UIButton *)sender {
    if ([self.input.text length] <= 0) {
        return [RLHud msg:LS(@"昵称不能为空")];
    }else if ([self.input.text isNumberOrAlphabet] == NO){
        return [RLHud msg:LS(@"昵称只能包含数字和字母")];
    }
    if (self.block) {
        self.block(self.input.text);
    }
    [self dismissViewControllerAnimated:NO completion:nil];
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
